import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Lily
 * Date: 2024-10-13
 * Time: 22:26
 */
public class test_1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            String str = in.nextLine();
            int left = -1;
            int[] len = new int[2];
            for (int i = 0; i < str.length(); i++) {
                char ch = str.charAt(i);
                if ((ch <= '9' && ch >= '0') && (i == 0 || !(str.charAt(i - 1) <= '9' && str.charAt(i - 1) >= '0'))) {
                    left = i;
                }

                if ((ch <= '9' && ch >= '0') && (i == str.length() - 1 || !(str.charAt(i + 1) <= '9' && str.charAt(i + 1) >= '0'))) {
                    int tmp = i - left + 1;
                    if (tmp > len[1]) {
                        len[0] = left;
                        len[1] = tmp;
                    }
                }

            }
            System.out.println(str.substring(len[0], len[0] + len[1]));
        }
    }
}
